package com.atguigu.edu2021.mock.service.impl;

import com.atguigu.edu2021.mock.bean.ChapterInfo;
import com.atguigu.edu2021.mock.bean.CourseInfo;
import com.atguigu.edu2021.mock.mapper.CourseInfoMapper;
import com.atguigu.edu2021.mock.service.ChapterInfoService;
import com.atguigu.edu2021.mock.service.CourseInfoService;
import com.atguigu.edu2021.mock.service.adv.impl.AdvServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/**
 * <p>
 * 课程 课程 服务实现类
 * </p>
 *
 * @author zhangchen
 * @since 2021-09-05
 */
@Service
public class CourseInfoServiceImpl extends AdvServiceImpl<CourseInfoMapper, CourseInfo> implements CourseInfoService {

    @Autowired
    ChapterInfoService chapterInfoService;



    @PostConstruct
    protected void loadCache(){
         cache=new ConcurrentHashMap<>();
         List<CourseInfo> list =  baseMapper.selectCourseInfoWithChapter();
         loadCache(  list);

    }






}
